<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script type="text/javascript" src="js/jquery.1.10.1.min.js" ></script>
		<script>
			$(function(){
				var canvas = document.getElementById("canvas");
				canvas.width = 1024;
				canvas.height = 768;
				var context = canvas.getContext("2d");
				/*基于状态的*/
				if(context){
					context.beginPath();
					context.lineWidth=10;
					context.strokeStyle="#058";
					context.moveTo(100,100);
					context.lineTo(200,100);
					context.closePath();
					
					context.fillStyle="rgb(2,100,30)";
					context.fill();
					context.stroke();
					
					context.beginPath();
					context.moveTo(200,100);
					context.lineTo(700,800);
					context.closePath();
					context.strokeStyle="red";
					context.stroke();
					
				}else {
					alert("不支持canvas");
				}
			});
			
			
		</script>
	</head>
	<body>
		<canvas id="canvas"  style="border: 1px solid #aaa; display: block; margin: auto;">
		</canvas>
	</body>
</html>
